import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

class MyApp13 extends StatelessWidget {
  const MyApp13({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('ListView组件'),
        centerTitle: true,
        backgroundColor: Colors.lightGreen,
      ),
      body: ListView(
        // 垂直滚动
        scrollDirection: Axis.vertical,
        // 反向滚动
        reverse: true,
        // 禁止滚动
        // physics: NeverScrollableScrollPhysics(),
        children: [
          Container(height: 150, color: Colors.red, child: Text('我是容器组件1')),
          Container(height: 200, color: Colors.yellow, child: Text('我是容器组件2')),
          Container(height: 250, color: Colors.blue, child: Text('我是容器组件3')),
          Container(height: 300, color: Colors.green, child: Text('我是容器组件4')),
          Container(height: 350, color: Colors.cyan, child: Text('我是容器组件5')),
          Container(height: 400, color: Colors.purple, child: Text('我是容器组件6')),
        ],
      ),
    );
  }
}
